<form method = "post">
<input type='checkbox' id="checker_all" onclick='CheckAll(this.checked)'> <label for="checker_all">Check All</label><hr>
{foreach from=$Groups item=group key=dir_key}
<input type="checkbox" id="checker_{$dir_key}" onclick="CheckGroup('{$dir_key}', this.checked)"><label for="checker_{$dir_key}">[{$dir_key}]</label>
<br />
{foreach from=$group.files item=row key=num}
<input type="checkbox" name="files[{$dir_key}][{$num}]" value="{$num}" id="chk_{$dir_key}_{$num}" {if isset($Context.files[$dir_key][$num])}checked{/if} onClick="HightLightOneLabel('label_'+this.id, this.checked)"><label id="label_chk_{$dir_key}_{$num}" for="chk_{$dir_key}_{$num}">{$row}</label><br />
{/foreach}
-----------------------------<br />
{/foreach}
<input type='submit' value='   Go   '>
<input type='hidden' name='go' value='1'>
</form>
<script type="text/javascript">
{literal}

function HightLightOneLabel(id, status)
{
     el = document.getElementById(id);
     el.style.fontWeight = status?'bold':'normal';
}
/////////////////////////////////////////////////////////////////////////////

function HightLightLabels()
{
     f = document.forms[0];
     for (i = 0; i< f.length; i++)
     {
          if (-1 != f[i].name.indexOf('files'))
          {
               HightLightOneLabel('label_'+f[i].id, f[i].checked);
          }
     }
}
/////////////////////////////////////////////////////////////////////////////

function CheckAll(status)
{
     f = document.forms[0];
     for (i = 0; i< f.length; i++)
     {
          if (-1 != f[i].name.indexOf('files'))
          {
               f[i].checked = status;
               HightLightOneLabel('label_'+f[i].id, f[i].checked);
          }
     }
}
////////////////////////////////////////////////////////////////////////////

function CheckGroup(group, status)
{
     f = document.forms[0];
     for (i = 0; i< f.length; i++)
     {
          if (-1 != f[i].name.indexOf('files['+group+']'))
          {
               f[i].checked = status;
               HightLightOneLabel('label_'+f[i].id, f[i].checked);
          }
     }
}
HightLightLabels();
{/literal}
</script>
